package hk.cic.demointegrationapp;

import com.alibaba.fastjson.JSON;

import java.io.Serializable;

/**
 * user:cily
 * time:2017/8/6
 * desc:
 */

public class ParamBaseBean implements Serializable{
    private BgDataBean bgdata;

    public BgDataBean getBgdata() {
        return bgdata;
    }

    public void setBgdata(BgDataBean bgdata) {
        this.bgdata = bgdata;
    }

    public static class BgDataBean<T> implements Serializable{
        private String ClientVersion;
        private String ActionType;
        private T data;

        public String getClientVersion() {
            return ClientVersion;
        }

        public void setClientVersion(String clientVersion) {
            ClientVersion = clientVersion;
        }

        public String getActionType() {
            return ActionType;
        }

        public void setActionType(String actionType) {
            ActionType = actionType;
        }

        public T getData() {
            return data;
        }

        public void setData(T data) {
            this.data = data;
        }

        @Override
        public String toString() {
            return "BgDataBean{" +
                    "ClientVersion='" + ClientVersion + '\'' +
                    ", ActionType='" + ActionType + '\'' +
                    ", data=" + data +
                    '}';
        }
    }

    public static String toJsonParam(ParamBaseBean bean){
        if (bean != null){
            return JSON.toJSONString(bean);
        }else {
            return null;
        }
    }
}
